<?php
class Mageex_RelatedProduct_Block_Adminhtml_RelatedProduct_Edit_FormType extends Mage_Adminhtml_Block_Widget_Form
{
    /**
     * Define Form settings
     *
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Prepare form before rendering HTML
     *
     */
    protected function _prepareForm()
    {
        $model  = $this->getModel();
        $form   = new Varien_Data_Form(array(
            'id'        => 'edit_form',
            'action'    => $this->getData('action'),
            'method'    => 'post'
        ));

        $fieldset   = $form->addFieldset('base_fieldset', array(
            'legend'    => Mage::helper('newsletter')->__('Select block type'),
            'class'     => 'fieldset-wide'
        ));
		
		$fieldset->addField('type', 'select', array(
                'name'      => 'type',
                'label'     => Mage::helper('relatedproduct')->__('Block Type'),
                'title'     => Mage::helper('relatedproduct')->__('Block Type'),
                'required'  => true,
                'values'    => array('product'=>'Product Block','category'=>'Category Block'),
        ));
		
		$field = $fieldset->addField('new_password', 'text',
            array(
                'label' => Mage::helper('relatedproduct')->__('New Password'),
                'name'  => 'new_password',
                'class' => 'validate-new-password'
            )
        );
		
		$field->setRenderer($this->getLayout()->createBlock('relatedproduct/adminhtml_relatedproduct_edit_renderer_button'));
		
        $form->setAction($this->getUrl('*/*/save'));
        $form->setUseContainer(true);
        $this->setForm($form);

        return parent::_prepareForm();
    }
}
